package com.jinmdz.fmis.api.api.controller;

import com.jinmdz.fmis.api.api.model.common.IdVersionData;
import com.jinmdz.fmis.api.api.model.photoarchival.*;
import com.jinmdz.fmis.api.api.service.PhotoArchivalService;
import com.jinmdz.fmis.api.base.BaseController;
import com.jinmdz.fmis.core.base.BaseResult;
import com.jinmdz.fmis.dao.model.document.PhotoDocumentFileItem;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;


/**
 * 遗体接运相关接口
 *
 * @author GaoXiangLiang
 * @date 2020/8/24 17:59
 */
@Api(description = "遗体接运相关接口")
@RestController()
@RequestMapping("/api/body-receiving")
public class BodyReceivingController extends BaseController {

    @Resource
    private PhotoArchivalService photoArchivalService;

    /**
     * 遗体抓拍摄像头拍照备案保存接口
     * @param data 图片类型信息
     * @return
     * @author GaoXiangLiang
     * @date 2020/08/25 13:38
     */
    @ApiOperation(value = "遗体抓拍摄像头拍照备案保存接口",
            notes = "遗体抓拍摄像头拍照备案保存接口，数据保存到数据表【document_file】")
    @PostMapping("/save-body-photo-for-record")
    public BaseResult<PhotoArchivalItem> saveBodyPhotoForRecord(@RequestBody PhotoBodyData data) {
        return resultHandler(data, userItem -> photoArchivalService.saveBodyPhotoForRecord(userItem, data.getData(), data.getBodyImageFileOne(), data.getBodyImageFileTwo(),data.getBodyImageFileThree()));
    }

    
}
